package com.daon.pojo;

import java.util.Date;

public class SysLog {
    private Integer logId;

    private Integer logType;

    private String logUrl;

    private String logMethod;

    private String logIp;

    private Integer logUserId;

    private String logUserName;

    private Date createdAt;

    public SysLog(Integer logId, Integer logType, String logUrl, String logMethod, String logIp, Integer logUserId, String logUserName, Date createdAt) {
        this.logId = logId;
        this.logType = logType;
        this.logUrl = logUrl;
        this.logMethod = logMethod;
        this.logIp = logIp;
        this.logUserId = logUserId;
        this.logUserName = logUserName;
        this.createdAt = createdAt;
    }

    public SysLog() {
        super();
    }

    public Integer getLogId() {
        return logId;
    }

    public void setLogId(Integer logId) {
        this.logId = logId;
    }

    public Integer getLogType() {
        return logType;
    }

    public void setLogType(int logType) {
        this.logType = logType;
    }

    public String getLogUrl() {
        return logUrl;
    }

    public void setLogUrl(String logUrl) {
        this.logUrl = logUrl == null ? null : logUrl.trim();
    }

    public String getLogMethod() {
        return logMethod;
    }

    public void setLogMethod(String logMethod) {
        this.logMethod = logMethod == null ? null : logMethod.trim();
    }

    public String getLogIp() {
        return logIp;
    }

    public void setLogIp(String logIp) {
        this.logIp = logIp == null ? null : logIp.trim();
    }

    public Integer getLogUserId() {
        return logUserId;
    }

    public void setLogUserId(Integer logUserId) {
        this.logUserId = logUserId;
    }

    public String getLogUserName() {
        return logUserName;
    }

    public void setLogUserName(String logUserName) {
        this.logUserName = logUserName == null ? null : logUserName.trim();
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public String getLogTypeName(){
        String logTypeName = "页面访问";
        switch (logType){
            case 1:
                logTypeName = "页面访问";
                break;
            case 2:
                logTypeName = "数据提交";
                break;
        }
        return logTypeName;
    }
}